#include <stdio.h>
#include <string.h>

#define	BITS	(32) 

extern void dtob(int *decimal, int *bits);

int main(int argc, char **argv) {
	int i = 0;
	int flag = 0;
	int decimal = 0;
	int bits[BITS];
	
	//memset(bits, 0, BITS);
	for (i = 0; i < BITS; i++) {
		bits[i] = 0;
		//printf("%d ", bits[i]);
	}
	printf("Enter decimal:");
	scanf("%d", &decimal);
	dtob(&decimal, bits);
	printf("Binary ones:\n");
	for (i = 31; i >= 0; i--) {
		if (bits[i]) {
			flag = 1;
		}
		if (flag) {
			printf("%d", bits[i]);
		}
	}
	
	printf("\n");
	return 0;
}